//
//  ExchangeMailViewController.m
//  WuLi
//
//  Created by Gollum on 16/9/3.
//  Copyright © 2016年 Gollum. All rights reserved.
//

#import "ExchangeMailViewController.h"
#import "NetworkTool.h"
@interface ExchangeMailViewController ()
@property (weak, nonatomic) IBOutlet UIWebView *webView;

@end

@implementation ExchangeMailViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    NSString *urlString = @"http://211.151.51.80/v1/trade/login/url?redirect=";
    
    NSDictionary *header = @{@"User-Agent":@"Dalvik/2.1.0 (Linux; U; Android 5.0; ASUS_Z00ADB Build/LRX21V) Wuli/2.3.1 (agent:s;channel:wandoujia;credential:e1MyMDEwMDAxMDF9LXsjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIzM1Nzg3MjA2MTcxNDM4M30teyMjIyMjIyMxNDcyMDAyMTMyOTYzLTJlZjRjNThjZDJ9QDE0NzExODgxOTgzODY=;deviceId:357872061714383;osTypeId:01;detailInfo:android;simTypeId:01;netTypeId:01;deviceTypeId:01;osVersion:5.0;idfa:null)", @"Host":@"api.5wuli.com"};

    
    #pragma mark -
//    NSString *urlString = @"http://www.duiba.com.cn/chome/index?spm=8838.1.1.1";
//    NSDictionary *header = @{@"Host":@"www.duiba.com.cn", @"User-Agent":@"Mozilla/5.0 (Linux; Android 5.0; ASUS_Z00ADB Build/LRX21V; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/43.0.2357.121 Mobile Safari/537.36 Duiba/1.0.7", @"Cookie":@"wdata3=7wj2WuH94tkgWy4NMv8nX6Yy3QLz9ZoqHu1SkeTFgKFTWHsCWmF", @"X-Requested-With":@"com.caishi.cronus"};
    
    
    
    [NetworkTool GET:urlString andBody:nil andHeader:header andResponse:JHJSON andSuccessBlock:^(id result) {
        
        //        NSLog(@"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++%@",result);
        NSString *urlStr = result[@"data"];
        NSURL *url = [NSURL URLWithString:urlStr];
        NSURLRequest *urlRequest = [[NSURLRequest alloc] initWithURL:url];
        [_webView loadRequest:urlRequest];
        
    } andFailureBlock:^(NSError *error) {
        
    }];
    
    
    
}


- (IBAction)handleBack:(id)sender {
    [self dismissViewControllerAnimated:YES completion:^{
        
    }];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
